Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename TopographicMap => SubsurfaceMap. Add global colorscale #302

Merged
merged 4 commits into from
Sep 26, 2023

Conversation

HansKallekleiv
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@rubenthoms rubenthoms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider moving the color scale function into ColorScale since it is going to be consumed in several map modules. Otherwise, two small comments.


import { formatRgb } from "culori";

function rgbStringToArray(rgbString: string): number[] | null {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider removing this function when implementing the suggestion below.

Otherwise:

function rgbStringToTuple(rgbString: string): [number, number, number] | null

const hexColors = colorScale.getPlotlyColorScale();
const rgbArr: [number, number, number, number][] = [];
hexColors.forEach((color) => {
const rgbString: string = formatRgb(color[1]) as string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://culorijs.org/api/#parse

import { parse } from "culori";
...
hexColors.forEach((hexColor) => {
    const rgbColor = parse(hexColor); // Returns object with r, g, b items for hex strings
    rgbArr.push([hexColor[0], rgbColor.r, rgbColor.g, rgbColor.b]);
});

Copy link
Collaborator

@rubenthoms rubenthoms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@HansKallekleiv HansKallekleiv merged commit 90b4ea7 into equinor:main Sep 26, 2023
3 checks passed
@HansKallekleiv HansKallekleiv deleted the subsurface-map branch September 26, 2023 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants